﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.IM;
using yunbo.Repositorys.IMRepositorys;

namespace yunbo.Controllers.IMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_CKPDXXController : ControllerBase
    {
        WMS_CKPDXXRepository wMS_CKPDXXRepository=new WMS_CKPDXXRepository();
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [HttpPost("PostWMS_CKPDXX")]
        public IActionResult PostWMS_CKPDXX(TJWMS_CKPDXX wMS_CKPDXX)
        {
            bool rs = wMS_CKPDXXRepository.PostWMS_CKPDXX(wMS_CKPDXX) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetCXWMS_CKPDXX")]
        public IActionResult GetCXWMS_CKPDXX(int PageNumber, int PageSize,string code)
        {
            FYCXWMS_CKPDXX fYCXWMS_CKPDXX = wMS_CKPDXXRepository.GetCXWMS_CKPDXX(PageNumber, PageSize,code);
            return Ok(fYCXWMS_CKPDXX);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateWMS_CKPDXX")]
        public IActionResult UpdateWMS_CKPDXX(int pdsl, decimal sl, string code)
        {
            bool rs = wMS_CKPDXXRepository.UpdateWMS_CKPDXX(pdsl, sl, code) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 修改ZT
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateWMS_CKPDZT")]
        public IActionResult UpdateWMS_CKPDXXZT(string code, string pdtzcode, string state)
        {
            bool rs = wMS_CKPDXXRepository.UpdateWMS_CKPDXXZT(code, pdtzcode, state) > 0;
            return Ok(rs);
        }
    }
}
